package {
	import org.flixel.*;
	
	public class BasicBlock extends FlxSprite {
		
		[Embed(source = "../assets/goldorb.png")] protected var goldorb:Class; //0
		[Embed(source = "../assets/greenorb.png")] protected var greenorb:Class; //1
		[Embed(source = "../assets/greyorb.png")] protected var greyorb:Class; //2
		[Embed(source="../assets/pinkorb.png")] protected var pinkorb:Class; //3
		[Embed(source="../assets/redorb.png")] protected var redorb:Class; //4
		[Embed(source = "../assets/purpleorb.png")] protected var purpleorb:Class; //5
		
		[Embed(source = "../assets/turqorb.png")] protected var turqorb:Class; //6
		[Embed(source = "../assets/whiteorb.png")] protected var whiteorb:Class; //7
		[Embed(source = "../assets/yelloworb.png")] protected var yelloworb:Class; //8
		
		private var colorArray:Array = new Array(goldorb, greenorb, greyorb, pinkorb, redorb, purpleorb, turqorb, whiteorb, yelloworb);
		private var hexArray:Array = new Array(0xffffc700, 0xff00FF00, 0xffC0C0C0, 0xffFF6EB4, 0xffEE4000, 0xffBA55D3, 0xff00F5FF, 0xffFFFAF0, 0xffFFFF00 );
		private var type:int;
		public var r:int, c:int;
		//private var BlockCor:Coordinate; var type:int;
		
		public function BasicBlock(row:int, col:int) {
			type = Math.round(Math.random() * 8);
			loadGraphic(colorArray[type], true, true, 32);
			r = row; c = col;
		}
		
		public function getType():int {
			return type;
		}
		
		public function setType(ty:int):void {
			type = ty;
			loadGraphic(colorArray[type], true, true, 32);
		}
		
		public function makeParticleGraphic(p:FlxParticle):void{
			p.makeGraphic(5,5,hexArray[type]);
		}
	}
}
	
		